package com.gydz.gydzbaseframeworkboot.Common.utils.page;

import org.apache.commons.lang3.StringUtils;

import java.util.List;

public class PageParam {


	private int sEcho;
	/**
	 * 开始页面
	 */
	private int iDisplayStart;

	/**
	 * 每页数据条数
	 */
	private int iDisplayLength;

	private int iSortCol;

	/**
	 * 定义倒序还剩升序
	 */
	private String sSortDir;

	/**
	 * 定义排序字段
	 */
	private String sSortCol;

	/** 表名 */
	private String tableName;

	/** 表名列表 */
	private List<String> tableNameList;

	public PageParam(){}

	public PageParam(int iDisplayStart,int iDisplayLength,String sSortDir,String sSortCol){
		this.iDisplayStart = iDisplayStart;
		this.iDisplayLength = iDisplayLength;
		this.sSortDir = sSortDir;
		this.sSortCol = sSortCol;
	}

	public int getsEcho() {
		return sEcho;
	}

	public void setsEcho(int sEcho) {
		this.sEcho = sEcho;
	}

	public int getiDisplayStart() {
		return iDisplayStart;
	}

	public void setiDisplayStart(int iDisplayStart) {
		this.iDisplayStart = iDisplayStart;
	}

	public int getiDisplayLength() {
		if(iDisplayLength == 0){
			iDisplayLength = 1;
		}
		return iDisplayLength;
	}

	public void setiDisplayLength(int iDisplayLength) {
		this.iDisplayLength = iDisplayLength;
	}

	public int getiSortCol() {
		return iSortCol;
	}

	public void setiSortCol(int iSortCol) {
		this.iSortCol = iSortCol;
	}

	public String getsSortDir() {
		if(StringUtils.isBlank(sSortDir)){
			sSortDir = "";
		}
		return sSortDir;
	}

	public void setsSortDir(String sSortDir) {
		this.sSortDir = sSortDir;
	}

	public String getsSortCol() {
		if(StringUtils.isBlank(sSortCol)){
			sSortCol = "";
		}
		return sSortCol;
	}

	public void setsSortCol(String sSortCol) {
		this.sSortCol = sSortCol;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public List<String> getTableNameList() {
		return tableNameList;
	}

	public void setTableNameList(List<String> tableNameList) {
		this.tableNameList = tableNameList;
	}
}
